﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HYCodeBase.StringUtility
{
	public static class StringUtilityMethod
	{
		public static List<string> SplitStringByCount(string strInput, uint useCount)
		{
			List<string> list = new List<string>();
			if (string.IsNullOrWhiteSpace(strInput))
			{
				return list;
			}
			int num;
			for (int i = 0; i < strInput.Length; i += num)
			{
                num = System.Math.Min(strInput.Length - i, (int)useCount);
				if (num == 0)
				{
					num = 1;
				}
				string item = strInput.Substring(i, num);
				list.Add(item);
			}
			return list;
		}

		public static string MergeListString(List<string> lstInput)
		{
			StringBuilder stringBuilder = new StringBuilder();
			foreach (string text in lstInput)
			{
				if (text != null)
				{
					stringBuilder.Append(text);
				}
			}
			return stringBuilder.ToString();
		}
	}
}
